<template>
    <page>
        <infinite class="ofay absfit" :on-infinite="onInfinite">
            <!--<ul flex="box:mean" class="h50 tc f16 white-bg">-->
            <!--<li>已消费: 2笔</li>-->
            <!--<li>共消费: 800笔</li>-->
            <!--</ul>-->
            <m-header>微信支付记录</m-header>
            <m-header3 :title="nowDate | dateFormat('YYYY年MM月')">共消费{{monthTotal / 100}}元</m-header3>
            <div class="white-bg item px12 bdt" flex="dir:top main:center" v-for="i in list">
                <p class="f16" flex="main:justify">{{i.shopName}}<span>{{i.payMoney / 100}}元</span></p>
                <div class="f14 text3 mt4" flex="cross:center">
                    <span flex-box="1">{{i.payDate | dateFormat}}</span>
                    <span class="c7 mr8" v-if="i.getIntegral">+{{i.getIntegral}}积分</span>
                    <span class="c1 mr10" v-if="i.refund">已退款</span>
                    <span class="bg2 white px8 py2 corner">{{i.oilCode}}</span>
                </div>
            </div>
        </infinite>
    </page>
</template>
<script>
  export default {
    data () {
      return {
        monthTotal: 0,
        total: 0,
        nowDate: Date.now(),
        list: []
      }
    },
    computed: {},
    async created () {
      let body = await this.$get_delay_once('shift/getMonthShiftDetailByUserId')
      let {total, month} = body.obj
      this.monthTotal = month
      this.total = total
    },
    methods: {
      PitsPullData () {},
      PitsPushData () {},
      async onInfinite (page) {
        let {obj: {dataList, total}} = await this.$get('shift/getShiftDatailByUserId', {
          page
        })
        this.list.push(...dataList)
        return this.list.length < total
      }
    },
    components: {}
  }
</script>
<style type="text/scss" lang="scss" scoped>
    .item {
        height: 70px;
    }
</style>
